<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>上传图片</title>
    <link href="/media/uploadify/uploadify.css" type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="/js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="/media/uploadify/jquery.uploadify.v2.1.4.js"></script>
    <script type="text/javascript" src="/media/uploadify/swfobject.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var file_name = '';
            $('#file_upload').uploadify({
                'uploader':'/media/uploadify/uploadify.swf', //根据文件存放地址改变
                'script':'/upload_script/',
                'cancelImg':'/media/uploadify/cancel.png', //根据文件存放地址改变
                'folder':'/image',
                'auto':true, //false,//
                'multi':true, //设置可以上传多个文件
                'simUploadLimit':1,
                'buttonText':'upload',
                'removeCompleted':false, //
                'sizeLimit':10240000, //设置上传文件大小单位kb
                'fileExt':'*.jpg;*.png;*.gif', //设置上传文件类型为常用文档格式
                'fileDesc':'支持文档格式',
                'onInit':function () {
                },
                'onError':function (event, ID, fileObj, errorObj) {
                    $('#id_span_msg').html("上传失败，错误码:" + errorObj.type + " " + errorObj.info);
                },
                'onSelect':function (e, queueId, fileObj) {
                    $('#id_span_msg').html("");
                },
                'onCancel':function (event, ID, fileObj, data) {
                    $.post("/delete_uploadfile/", { delete_file:file_name });
                    file_name = '';
                },
                'onComplete':function (event, ID, fileObj, response, data) {
                    var result = eval("(" + response + ")");
                    file_name = result.save_name;
                }
            });
        });
    </script>
</head>
<body>
<h1> Uploadify组件上传方式 </h1>

<div class="demo-box">
    <input id="file_upload" type="file" name="Filedata">

    <div id="file_uploadQueue" class="uploadifyQueue"></div>
    <p><span id="id_span_msg"></span>
    </p>
</div>
</body>
</html>